package com.googlecode.monitoring.db.model;

import java.io.Serializable;

/**
 * Author: Sergiy Doroshenko
 * Date: May 25, 2010
 * Time: 5:04:55 PM
 */
public class TableOfData implements Serializable {
	private String name;
	private String columnName;

	public TableOfData() {
	}

	public TableOfData(String name, String columnName) {
		this.name = name;
		this.columnName = columnName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder();
		sb.append("TableOfData");
		sb.append("{name='").append(name).append('\'');
		sb.append(", columnName='").append(columnName).append('\'');
		sb.append('}');
		return sb.toString();
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}

		TableOfData that = (TableOfData) o;

		if (name != null ? !name.equals(that.name) : that.name != null) {
			return false;
		}

		return true;
	}

	@Override
	public int hashCode() {
		return name != null ? name.hashCode() : 0;
	}
}
